package cc.magicjson.example.demo.task.optional;

public class PriorityScheduledTask implements Runnable, Comparable<PriorityScheduledTask> {
	private final Runnable task;
	private final long deadline;
	private final long period;
	private final int importance;
	private final long creationTime;

	public PriorityScheduledTask(Runnable task, long deadline, long period, int importance) {
		this.task = task;
		this.deadline = deadline;
		this.period = period;
		this.importance = importance;
		this.creationTime = System.currentTimeMillis();
	}

	@Override
	public void run() {
		task.run();
	}

	@Override
	public int compareTo(PriorityScheduledTask other) {
		return 0; // This will not be used directly
	}

	// Getters for the fields (deadline, period, importance, creationTime)
	public long getDeadline() {
		return deadline;
	}

	public long getPeriod() {
		return period;
	}

	public int getImportance() {
		return importance;
	}

	public long getCreationTime() {
		return creationTime;
	}
}